\(\int \sec ^6(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\) [171]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 106 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {(a+b)^2 \tan (e+f x)}{f}+\frac {2 (a+b) (a+2 b) \tan ^3(e+f x)}{3 f}+\frac {\left (a^2+6 a b+6 b^2\right ) \tan ^5(e+f x)}{5 f}+\frac {2 b (a+2 b) \tan ^7(e+f x)}{7 f}+\frac {b^2 \tan ^9(e+f x)}{9 f} \]

[Out]

(a+b)^2*tan(f*x+e)/f+2/3*(a+b)*(a+2*b)*tan(f*x+e)^3/f+1/5*(a^2+6*a*b+6*b^2)*tan(f*x+e)^5/f+2/7*b*(a+2*b)*tan(f
*x+e)^7/f+1/9*b^2*tan(f*x+e)^9/f

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {4231, 380} \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\left (a^2+6 a b+6 b^2\right ) \tan ^5(e+f x)}{5 f}+\frac {2 b (a+2 b) \tan ^7(e+f x)}{7 f}+\frac {2 (a+b) (a+2 b) \tan ^3(e+f x)}{3 f}+\frac {(a+b)^2 \tan (e+f x)}{f}+\frac {b^2 \tan ^9(e+f x)}{9 f} \]

[In]

Int[Sec[e + f*x]^6*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((a + b)^2*Tan[e + f*x])/f + (2*(a + b)*(a + 2*b)*Tan[e + f*x]^3)/(3*f) + ((a^2 + 6*a*b + 6*b^2)*Tan[e + f*x]^
5)/(5*f) + (2*b*(a + 2*b)*Tan[e + f*x]^7)/(7*f) + (b^2*Tan[e + f*x]^9)/(9*f)

Rule 380

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n
)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]

Rule 4231

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fre
eFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 + ff^2*x^2)^(m/2 - 1)*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/
2), x]^p, x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && IntegerQ[n/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (1+x^2\right )^2 \left (a+b+b x^2\right )^2 \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left ((a+b)^2+2 (a+b) (a+2 b) x^2+\left (a^2+6 a b+6 b^2\right ) x^4+2 b (a+2 b) x^6+b^2 x^8\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(a+b)^2 \tan (e+f x)}{f}+\frac {2 (a+b) (a+2 b) \tan ^3(e+f x)}{3 f}+\frac {\left (a^2+6 a b+6 b^2\right ) \tan ^5(e+f x)}{5 f}+\frac {2 b (a+2 b) \tan ^7(e+f x)}{7 f}+\frac {b^2 \tan ^9(e+f x)}{9 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.91 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {315 (a+b)^2 \tan (e+f x)+210 \left (a^2+3 a b+2 b^2\right ) \tan ^3(e+f x)+63 \left (a^2+6 a b+6 b^2\right ) \tan ^5(e+f x)+90 b (a+2 b) \tan ^7(e+f x)+35 b^2 \tan ^9(e+f x)}{315 f} \]

[In]

Integrate[Sec[e + f*x]^6*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(315*(a + b)^2*Tan[e + f*x] + 210*(a^2 + 3*a*b + 2*b^2)*Tan[e + f*x]^3 + 63*(a^2 + 6*a*b + 6*b^2)*Tan[e + f*x]
^5 + 90*b*(a + 2*b)*Tan[e + f*x]^7 + 35*b^2*Tan[e + f*x]^9)/(315*f)

Maple [A] (verified)

Time = 1.09 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.26

method result size
derivativedivides \(\frac {-a^{2} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )-2 a b \left (-\frac {16}{35}-\frac {\sec \left (f x +e \right )^{6}}{7}-\frac {6 \sec \left (f x +e \right )^{4}}{35}-\frac {8 \sec \left (f x +e \right )^{2}}{35}\right ) \tan \left (f x +e \right )-b^{2} \left (-\frac {128}{315}-\frac {\sec \left (f x +e \right )^{8}}{9}-\frac {8 \sec \left (f x +e \right )^{6}}{63}-\frac {16 \sec \left (f x +e \right )^{4}}{105}-\frac {64 \sec \left (f x +e \right )^{2}}{315}\right ) \tan \left (f x +e \right )}{f}\) \(134\)
default \(\frac {-a^{2} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )-2 a b \left (-\frac {16}{35}-\frac {\sec \left (f x +e \right )^{6}}{7}-\frac {6 \sec \left (f x +e \right )^{4}}{35}-\frac {8 \sec \left (f x +e \right )^{2}}{35}\right ) \tan \left (f x +e \right )-b^{2} \left (-\frac {128}{315}-\frac {\sec \left (f x +e \right )^{8}}{9}-\frac {8 \sec \left (f x +e \right )^{6}}{63}-\frac {16 \sec \left (f x +e \right )^{4}}{105}-\frac {64 \sec \left (f x +e \right )^{2}}{315}\right ) \tan \left (f x +e \right )}{f}\) \(134\)
parts \(-\frac {a^{2} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}-\frac {b^{2} \left (-\frac {128}{315}-\frac {\sec \left (f x +e \right )^{8}}{9}-\frac {8 \sec \left (f x +e \right )^{6}}{63}-\frac {16 \sec \left (f x +e \right )^{4}}{105}-\frac {64 \sec \left (f x +e \right )^{2}}{315}\right ) \tan \left (f x +e \right )}{f}-\frac {2 a b \left (-\frac {16}{35}-\frac {\sec \left (f x +e \right )^{6}}{7}-\frac {6 \sec \left (f x +e \right )^{4}}{35}-\frac {8 \sec \left (f x +e \right )^{2}}{35}\right ) \tan \left (f x +e \right )}{f}\) \(139\)
parallelrisch \(\frac {\left (10752 a^{2}+24192 a b +10752 b^{2}\right ) \sin \left (3 f x +3 e \right )+\left (6048 a^{2}+10368 a b +4608 b^{2}\right ) \sin \left (5 f x +5 e \right )+\left (1512 a^{2}+2592 a b +1152 b^{2}\right ) \sin \left (7 f x +7 e \right )+\left (168 a^{2}+288 a b +128 b^{2}\right ) \sin \left (9 f x +9 e \right )+6048 \sin \left (f x +e \right ) \left (a^{2}+\frac {8}{3} a b +\frac {8}{3} b^{2}\right )}{315 f \left (\cos \left (9 f x +9 e \right )+9 \cos \left (7 f x +7 e \right )+36 \cos \left (5 f x +5 e \right )+84 \cos \left (3 f x +3 e \right )+126 \cos \left (f x +e \right )\right )}\) \(181\)
risch \(\frac {16 i \left (210 a^{2} {\mathrm e}^{12 i \left (f x +e \right )}+945 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}+1260 a b \,{\mathrm e}^{10 i \left (f x +e \right )}+1701 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}+3276 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+2016 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+1554 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}+3024 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+1344 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+756 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}+1296 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+576 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+189 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}+324 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+144 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+21 a^{2}+36 a b +16 b^{2}\right )}{315 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{9}}\) \(240\)

[In]

int(sec(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(-a^2*(-8/15-1/5*sec(f*x+e)^4-4/15*sec(f*x+e)^2)*tan(f*x+e)-2*a*b*(-16/35-1/7*sec(f*x+e)^6-6/35*sec(f*x+e)
^4-8/35*sec(f*x+e)^2)*tan(f*x+e)-b^2*(-128/315-1/9*sec(f*x+e)^8-8/63*sec(f*x+e)^6-16/105*sec(f*x+e)^4-64/315*s
ec(f*x+e)^2)*tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.13 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {{\left (8 \, {\left (21 \, a^{2} + 36 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{8} + 4 \, {\left (21 \, a^{2} + 36 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{6} + 3 \, {\left (21 \, a^{2} + 36 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 10 \, {\left (9 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 35 \, b^{2}\right )} \sin \left (f x + e\right )}{315 \, f \cos \left (f x + e\right )^{9}} \]

[In]

integrate(sec(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/315*(8*(21*a^2 + 36*a*b + 16*b^2)*cos(f*x + e)^8 + 4*(21*a^2 + 36*a*b + 16*b^2)*cos(f*x + e)^6 + 3*(21*a^2 +
 36*a*b + 16*b^2)*cos(f*x + e)^4 + 10*(9*a*b + 4*b^2)*cos(f*x + e)^2 + 35*b^2)*sin(f*x + e)/(f*cos(f*x + e)^9)

Sympy [F]

\[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \sec ^{6}{\left (e + f x \right )}\, dx \]

[In]

integrate(sec(f*x+e)**6*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**2*sec(e + f*x)**6, x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.97 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {35 \, b^{2} \tan \left (f x + e\right )^{9} + 90 \, {\left (a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{7} + 63 \, {\left (a^{2} + 6 \, a b + 6 \, b^{2}\right )} \tan \left (f x + e\right )^{5} + 210 \, {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{3} + 315 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{315 \, f} \]

[In]

integrate(sec(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/315*(35*b^2*tan(f*x + e)^9 + 90*(a*b + 2*b^2)*tan(f*x + e)^7 + 63*(a^2 + 6*a*b + 6*b^2)*tan(f*x + e)^5 + 210
*(a^2 + 3*a*b + 2*b^2)*tan(f*x + e)^3 + 315*(a^2 + 2*a*b + b^2)*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.43 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {35 \, b^{2} \tan \left (f x + e\right )^{9} + 90 \, a b \tan \left (f x + e\right )^{7} + 180 \, b^{2} \tan \left (f x + e\right )^{7} + 63 \, a^{2} \tan \left (f x + e\right )^{5} + 378 \, a b \tan \left (f x + e\right )^{5} + 378 \, b^{2} \tan \left (f x + e\right )^{5} + 210 \, a^{2} \tan \left (f x + e\right )^{3} + 630 \, a b \tan \left (f x + e\right )^{3} + 420 \, b^{2} \tan \left (f x + e\right )^{3} + 315 \, a^{2} \tan \left (f x + e\right ) + 630 \, a b \tan \left (f x + e\right ) + 315 \, b^{2} \tan \left (f x + e\right )}{315 \, f} \]

[In]

integrate(sec(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/315*(35*b^2*tan(f*x + e)^9 + 90*a*b*tan(f*x + e)^7 + 180*b^2*tan(f*x + e)^7 + 63*a^2*tan(f*x + e)^5 + 378*a*
b*tan(f*x + e)^5 + 378*b^2*tan(f*x + e)^5 + 210*a^2*tan(f*x + e)^3 + 630*a*b*tan(f*x + e)^3 + 420*b^2*tan(f*x
+ e)^3 + 315*a^2*tan(f*x + e) + 630*a*b*tan(f*x + e) + 315*b^2*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 18.23 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.89 \[ \int \sec ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,{\left (a+b\right )}^2+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^9}{9}+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {2\,a^2}{3}+2\,a\,b+\frac {4\,b^2}{3}\right )+{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (\frac {a^2}{5}+\frac {6\,a\,b}{5}+\frac {6\,b^2}{5}\right )+\frac {2\,b\,{\mathrm {tan}\left (e+f\,x\right )}^7\,\left (a+2\,b\right )}{7}}{f} \]

[In]

int((a + b/cos(e + f*x)^2)^2/cos(e + f*x)^6,x)

[Out]

(tan(e + f*x)*(a + b)^2 + (b^2*tan(e + f*x)^9)/9 + tan(e + f*x)^3*(2*a*b + (2*a^2)/3 + (4*b^2)/3) + tan(e + f*
x)^5*((6*a*b)/5 + a^2/5 + (6*b^2)/5) + (2*b*tan(e + f*x)^7*(a + 2*b))/7)/f